import axios from 'axios';

//创建axios实例
const instance = axios.create({
  baseURL: 'https://restapi.amap.com/v3',
  timeout: 3000,
});

//响应拦截器
instance.interceptors.response.use(
  res => {
    return Promise.resolve(res.data);
  },
  err => {
    return Promise.reject(err);
  }
);

//导出axios实例
export default instance;
